package com.cy.pj.common.pojo;


import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;


/**
 * @param <T>
 */
@Data
@NoArgsConstructor
public class PageObject<T> implements Serializable {
    private static final long serialVersionUID = 4928381022722272695L;//类名《泛型》==》类泛型--》约束类中属性，方法参数以及返回值类型
    //private static final long serialVersionUID = 6780580291247550747L;//类泛型
    /**当前页的页码值*/
    private Integer pageCurrent;
    /**页面大小*/
    private Integer pageSize;
    /**总行数(通过查询获得)*/
    private Integer rowCount;
    /**总页数(通过计算获得)*/
    private Integer pageCount;
    /**当前页记录*/
    private List<T> records;
    //public PageObject(){}
    public PageObject(Integer pageCurrent, Integer pageSize, Integer rowCount, List<T> records) {
        this.pageCurrent = pageCurrent;
        this.pageSize = pageSize;
        this.rowCount = rowCount;
        this.records = records;
//                this.pageCount=rowCount/pageSize;
//                if(rowCount%pageSize!=0) {
//                        pageCount++;
//                }
        this.pageCount=(rowCount-1)/pageSize+1;
    }
/**
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getPageCurrent() {
        return pageCurrent;
    }

    public void setPageCurrent(Integer pageCurrent) {
        this.pageCurrent = pageCurrent;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getRowCount() {
        return rowCount;
    }

    public void setRowCount(Integer rowCount) {
        this.rowCount = rowCount;
    }

    public Integer getPageCount() {
        return pageCount;
    }

    public void setPageCount(Integer pageCount) {
        this.pageCount = pageCount;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }
 */
}
